<template>
	<view class="addDesktop">
		<view class="typeBox">
			<view class="typeitem"  :class="{typeitemed:currIndex == 0}" @click="handleCurrIndex(0)">
				安卓手机
			</view>
			<view class="typeitem"  :class="{typeitemed:currIndex == 1}" @click="handleCurrIndex(1)">
				苹果(iOS)手机
			</view>
		</view>
		<view class="dataBox" style="margin-top: 30rpx;">
			<view class="dataItem" v-for="(item,index) in iosData" :key="item.id" style="margin-bottom: 30rpx;">
				<view class="">
					{{item.name}}
				</view>
				<image class="" :src="item.url" style="width: 90%;height: 1200rpx;" @click="handleImgBig(item.url)"/>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	import {
		getGuide
	} from "@/api/api.js"
	export default {
		data() {
			return {
            iosData:[],
			currIndex : 0
			}
		},
		onLoad() {
			this.handleData()
		},
		methods: {
			async handleData() {
				let res = await getGuide({
					type:this.currIndex
				})
				this.iosData = res.data
				console.log("//////", res)
			},
			handleCurrIndex(index){
				this.currIndex = index
				this.handleData()
			},
			handleImgBig(url) {
				uni.previewImage({
					current: 0,
					urls: [url] //必须是网址路径，否则加载不出来，如：http：或https：
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.addDesktop{
		font-size: 40rpx;
		font-family: PingFang SC-Semibold, PingFang SC;
		font-weight: 600;
		color: #000000;
		line-height: 50rpx;
		padding: 20rpx;
		.typeBox{
			display: flex;
			.typeitem{
				width: 50%;
				height: 120rpx;
				text-align: center;
				line-height: 120rpx;
			}
			.typeitemed{
				color: red;
			}
		}
	}

</style>